home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Educational / PrimeSpiral / Source / PrimeSpiral.nib (.txt) < prev    next >
Encoding:
NeXT TypedStream Data  |  1995-06-12  |  63.5 KB  |  137 lines

  1. typedstream
  2. StreamTable
  3.     HashTable
  4. Object
  5. [20c]
  6. typedstream
  7. [602c]
  8. typedstream
  9.     HashTable
  10. Object
  11. SpiralView
  12. HeaderClass
  13. %%%%i@@
  14. viewnib
  15. version
  16. spiral:
  17. FirstResponder
  18. firstnib
  19. checkSpelling:
  20. alignSelCenter:
  21.     unscript:
  22. pasteFont:
  23. runPageLayout:
  24. superscript:
  25. copyRuler:
  26.     copyFont:
  27. selectAll:
  28. pasteRuler:
  29. toggleRuler:
  30. showGuessPanel:
  31. alignSelLeft:
  32. paste:
  33. performClose:
  34. arrangeInFront:
  35. subscript:
  36. copy:
  37. alignSelRight:
  38. delete:
  39. orderFrontColorPanel:
  40. underline:
  41. performMiniaturize:
  42. [64263c]
  43. typedstream
  44.     HashTable
  45. Object
  46. Bitmap
  47. Texture
  48. [13000c]*
  49. *"""*
  50. """ ""
  51. Picture
  52. [16500c]
  53. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUP
  54. UUUUUUUUUUUUUUUUUUUP
  55. UUUUUUUUUP
  56. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUP
  57. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUP
  58. NibData
  59. @@@@s
  60. Storage
  61. {*@@}
  62.     [21{*@@}]
  63. File's Owner
  64. CustomObject
  65. Application
  66.     InfoPanel
  67. WindowTemplate
  68. iiii***@s@
  69. Panel
  70.     Responder
  71. Button
  72. Control
  73. ButtonCell
  74. ActionCell
  75.     Helvetica
  76.     TextField
  77. TextFieldCell
  78. PrimeSpiral
  79. Times-BoldItalic$
  80. )by C.D.Lane (lane@sumex-aim.stanford.edu)
  81. Times-Bold
  82. /Copyright 1990, Leland Stanford Jr. University.
  83. mon da year
  84. Courier-Bold
  85. /This application is dedicated to Alan J. Perlis
  86. Times-Roman
  87. Field1
  88. Field2
  89. Field
  90. Field3
  91. Field4
  92. MainMenu
  93. MenuTemplate
  94. *@*@ccc
  95. Matrix
  96. @:@iiii
  97. MenuCell
  98. Info Panel...
  99. Help...
  100. ff@@#::s
  101. submenuAction:
  102.     menuArrow
  103. Spiral
  104. Submenu
  105. SpiralWindow
  106. Window
  107. CustomView
  108. SpiralView
  109.     HelpPanel
  110. ScrollView
  111. ClipView
  112. ciifffcfffs
  113. [2318c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
  114. \margl40
  115. \margr40
  116. {\colortbl\red0\green0\blue0;}
  117. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b\i0\ul0\fs24\fc0 PrimeSpiral is a demonstration application with no utility value.  To run it, shape the main window to suit (under 2.0 the initial size requires about 12 seconds to complete on an '040 NeXT and about 30 seconds on '030 hardware) and select the 'Spiral' menu item to start the program running.\
  118. The concept of the prime spiral is simple: start at the center of a square and spiral outwards, inverting those bits whose positions on the spiral correspond to a prime number.  Since there is no formula to generate primes, they have to be determined by algorithm, you would expect the pattern to be random (about a ~10% gray shade since that is roughly the frequency of primes).  What you get instead are numerous broken diagonal lines, voids and other patterns (let your imagination and intuition figure out why).\
  119. The prime spiral also represents a benchmark as it tests how efficiently your workstation (or programmer) can compute primes and plot single bit data points on a graphic display.  We implemented this program on several different workstations.  You can start with either zero as your center (like this implementation) or one (like our CommonLisp ones), it doesn't really affect the resulting pattern.  The direction you spiral doesn't matter either.\
  120. The concept of the prime spiral was described to Christopher Schmidt (formerly of SUMEX-AIM, now an independent software developer) and myself (among others) by Alan Perlis when we were undergraduates at Yale (~1980).  Our first implementation was in Interlisp on the Xerox 1100 in 1983.  Recently (February 1990), Christopher Schmidt and Richard Acuff reimplemented the program under CommonLisp for the Macintosh (Procyon CommonLisp), and TI microExplorer and Explorer II, as well as the Xerox 1186 running Xerox CommonLisp.  This NeXT implementation is our first non-Lisp port of the program.\
  121. According to Perlis, someone once produced a tablecloth with this pattern--if anyone knows more about that, please let me know.  Any optimizations to the prime generation or graphics code would also be most welcome.\
  122. - Christopher (lane@sumex-aim.stanford.edu)
  123. NXCursor
  124. NXImage
  125. NXibeam
  126. Scroller
  127. _doScroller:
  128. @@@ffs"
  129. ScrollingText
  130. {i*@@@}
  131. [6{i*@@@}]
  132. hide:
  133. terminate:
  134. spiral:
  135. version
  136. makeKeyAndOrderFront:
  137.